package org.aurora.samples.quick.start.spring.task;

import org.aurora.client.ITaskProcessor;
import org.aurora.common.util.SystemTimeUtil;
import org.aurora.model.entity.ScheduleTaskContext;
import org.springframework.stereotype.Component;

import java.util.Date;

// 注册为 bean
@Component
public class AuroraAnnotationTaskBean implements ITaskProcessor {
    @Override
    public void processor(ScheduleTaskContext taskContext) throws Exception {
        System.out.println(String.format("processor task success, expectedSchedulerTime = %s, actualSchedulerTime = %s, currentTime = %s...",
                taskContext.getExpectedSchedulerTime(), taskContext.getActualSchedulerTime(), new Date()));
    }
    @Override
    public String taskName() {
        return "testTaskName1";
    }
}
